package hongcaosp.app.android.contact.good;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;

import hongcaosp.app.android.R;
import hongcaosp.app.android.common.BaseHolder;
import hongcaosp.app.android.modle.bean.IGooder;
import xlj.lib.android.base.utils.GlideUtils;
import xlj.lib.android.base.view.CircleImageView;

public class GoodHolder extends BaseHolder<IGooder> {
    private Context context;
    private ImageView userLogoIV;
    private TextView userNameTV,timeTV,descripTV;
    private ImageView videoCoverIV;

    public GoodHolder(View itemView, Context context) {
        super(itemView);
        this.context = context;

        userLogoIV = itemView.findViewById(R.id.user_logo);
        userNameTV = itemView.findViewById(R.id.user_name);
        timeTV = itemView.findViewById(R.id.fan_time);
        descripTV = itemView.findViewById(R.id.descrip);
        videoCoverIV = itemView.findViewById(R.id.video_cover);
    }

    @Override
    public void setData(final IGooder iGooder) {
        super.setData(iGooder);
        GlideUtils.loadCircleImage(context,iGooder.getImage(),userLogoIV,R.drawable.icon_head);
        userNameTV.setText(iGooder.getNickname());
        descripTV.setText(iGooder.goodDes());
        timeTV.setText(iGooder.getTime());
        Glide.with(context).load(iGooder.getCoverPath()).placeholder(R.drawable.icon_user_head).into(videoCoverIV);
    }
}
